import { ref, reactive } from 'vue'
import { ElForm } from 'element-plus'
import { LoginParm } from '@/api/user/UserModel'
export default function useBaseLogin() {
  // 1 表单类型 2 登录类型 3 校验类型
  const loginFormRef = ref<InstanceType<typeof ElForm>>()

  const loginModel = reactive<LoginParm>({
      username: 'anzimo4', // anzimo
      password: '123456',
      loginType: ''
  })
  const rules = reactive({
    username: [{
      required: true,
      trigger: 'blur',
      message: '请填入用户信息'
    }],
    password: [
      {
        required: true,
        trigger: 'blur',
        message: '请输入用户密码'
      }
    ]
  })
  return {
    loginFormRef,
    loginModel,
    rules
  }
}